subroutine output
    use commondata
    implicit none
    
    open(900, file='result.dat')
    write(900,*) 'title = "2D-Euler"'
    write(900,*) 'variables=', '"x","y","rho","u","v","p","T"'
    write(900,*) 'zone t= "', tn, '",i=',jn+1, ',j=',im+1, ',f=point'
    do i = 0, im
        do j = 0, jn
            if( FLG_prob==3 .and. i>=ifs .and. j<=jfs ) var(:,i,j) = -5.d0
            write(900,*) xr(i,j), ys(i,j), var(1,i,j), var(2,i,j), &
                var(3,i,j), var(4,i,j), var(4,i,j)/var(1,i,j)
        end do
    end do
    close(900)
    
    open(111, file='Euler.dat')
    write(111,*) tn
    do k = 1, kn
        do i = -4, im+4
            do j = -4, jn+4
                write(111,*) v1(k,i,j)
            end do
        end do
    end do
    close(111)
    
    open(200, file='rho-p.dat')
    j = jn/2 + 1
    do i = 0, im
        write(200,*) xr(i,j), var(1,i,j), var(4,i,j)
    end do
    
end subroutine output